www.gusucode.com > 中国货源网导航程序源码 1 > 中国货源网导航程序源码 1.0/8月11日备份/admin/wz_search.asp

    <!--#include file="mdb.asp"-->
<%
dim by,word,pn
by=request("by")
word=request("word")
pn=request("pn")
if by="url" then
sql="select * from detail where url like '%"&word&"%' and zhang<=1 order by yl_intime desc"
else
sql="select * from detail where title like '%"&word&"%' and zhang<=1 order by yl_intime desc"
end if
%>
<HTML>
<HEAD>
<TITLE>网站搜索结果</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="../css/style.css" TYPE="text/css">
</HEAD>
<BODY>

<table width=100% border=1 align=center cellpadding=0 cellspacing=0 bordercolorlight=#cecece bordercolordark=#ffffff>
<tr>
<td height=25 bgcolor=#ececec align=middle colspan=8>&nbsp;<font color=#FF0000>★<B>网站搜索结果</B>★</font></td></tr>
<tr>
<td nowrap>编号</td>
<td>网站名称</td>
<td>网站url</td>
<td nowrap>所属分类</td>
<td>编辑</td>
<td>删除</td>
</tr>
<%
if pn="" then pn=1
set r=server.createobject("adodb.recordset")
r.open sql,conn,1,3
if  r.eof or r.bof then
response.write "<tr><td height=25 colspan=8 align=middle>没有找到所需记录!</td></tr>"
response.end
end if
r.pagesize=50
r.absolutepage=pn
rowcount=r.pagesize
do while not r.eof and not r.bof and rowcount>0
set rr=server.createobject("adodb.recordset")
rr.open "select * from feilei where classid="&r("classid"),conn,1,3
response.write "<td nowrap>"&r("id")&"</td>"
response.write "<td nowrap>"&r("title")&"</td>"
response.write "<td nowrap>"&r("url")&"</td>"
response.write "<td nowrap>"&rr("classname")&"</td>"
response.write "<td nowrap><a href='wz_edit.asp?id="&r("id")&"'>编辑</a></td>"  
response.write "<td nowrap><a href='admin_detail_list1.asp?pn=1&delete="&r("id")&"'>删除</a></td></tr>" 
rr.close                   
set rr=nothing
rowcount=rowcount-1
r.movenext
loop
%>
<tr>
<td height=25 bgcolor=#ececec colspan=8>&nbsp;
<%  
ppage=pn-1  
npage=pn+1  
totalpage=r.pagecount  
if cint(totalpage)>cint(pn) then  
%> 
每页显示<%=r.pagesize%>个网站,当前第<%=pn%>页,总共<%=totalpage%>页
<a href='<%=request.servervariables("script_name")%>?pn=1'>首页</a>  
<a href='<%=request.servervariables("script_name")%>?pn=<%=ppage%>'>上一页</a>  
<a href='<%=request.servervariables("script_name")%>?pn=<%=npage%>'>下一页</a>  
<a href='<%=request.servervariables("script_name")%>?pn=<%=totalpage%>'>尾页</a>  
<%  
else  
if pn=1 then  
%>
每页显示<%=r.pagesize%>个网站,当前第<%=pn%>页,总共<%=totalpage%>页  
<a href='<%=request.servervariables("script_name")%>?pn=1'>首页</a>  
<a href='<%=request.servervariables("script_name")%>?pn=<%=npage%>'>下一页</a>  
<a href='<%=request.servervariables("script_name")%>?pn=<%=totalpage%>'>尾页</a>  
<%  
else  
%>
每页显示<%=r.pagesize%>个网站,当前第<%=pn%>页,总共<%=totalpage%>页
<a href='<%=request.servervariables("script_name")%>?pn=1'>首页</a>
<a href='<%=request.servervariables("script_name")%>?pn=<%=ppage%>'>上一页</a>
<a href='<%=request.servervariables("script_name")%>?pn=<%=totalpage%>'>尾页</a>
<%  
end if
end if
%>
</td></tr>
</table>
</BODY> 
</HTML>